Introduction to Java

Package Explorer Files

Java has a few standards that are good to follow to keep things uniform with the rest of the universe.
If you recognize the naming conventions it will help you identify more quickly what the different files are in your Package Explorer.

For Example, your src folder (stands for source) is where your own Java code will go.
It's best practice to add another folder (package in Java terms) inside the src package and name it all lowercase letters.

Then inside your new package is where you can create your first Class file.
Your class file starts with a Capital letter and it too has no spaces in the name.

When you create a new class, in the Package Explorer it will end with the extension '.java' (don't write that when you name it though!)
A class is nothing but a blueprint or a template for creating different objects which defines its properties and behaviors.

If you need Rename a package, or class, you RIGHT CLICK on the file then select Refactor > Rename...


Activity

Click Here For Video Review

  1. Have Eclipse open and you should see your Java Project in the Package Explorer to the left.
  2. Click on the arrow next to your Java Project so you can see the packages src and JRE System Library
  3. Hint
  4. RIGHT CLICK on the package src and select New > Package and name it code.
    1. Remember, package names should be all lowercase.
    Hint
  5. RIGHT CLICK on the new package code and select New > Class
  6. Hint
  7. Name your new class Hello then click finish.
    1. Remember, class names should start with an Uppercase letter.
    Hint



Very good, you're doing great!
Go Ahead and move on to the next lesson!